#/bin/sh
rm -rf demo.o demo.riscv demo.vcd demo.bin
riscv64-unknown-elf-gcc -fno-common -fno-builtin-printf -specs=htif_nano.specs -c demo.c
riscv64-unknown-elf-gcc -static -specs=htif_nano.specs demo.o -o demo.riscv
riscv64-unknown-elf-objcopy -O binary --change-addresses=-0x10000 demo.riscv demo.bin
../sims/verilator/simulator-chipyard-RocketConfig-debug --vcd=demo.vcd demo.riscv +image_bin=./u-boot-spl.bin
#gtkwave demo.vcd
rm -rf demo.o demo.riscv demo.vcd demo.bin
